#ifndef ODBCWRAPPER_H_
#define ODBCWRAPPER_H_

#include <sql.h>
#include <sqlext.h>

#include "DynLib.h"

// TYPEDEFs for function pointers

typedef SQLRETURN SQL_API _fn_SQLAllocConnectType(SQLHENV EnvironmentHandle, SQLHDBC * ConnectionHandle);

typedef SQLRETURN SQL_API _fn_SQLAllocEnvType(SQLHENV * EnvironmentHandle);

typedef SQLRETURN SQL_API _fn_SQLAllocStmtType(SQLHDBC ConnectionHandle, SQLHSTMT * StatementHandle);

typedef SQLRETURN SQL_API _fn_SQLAllocHandleType(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE * OutputHandle);

typedef SQLRETURN SQL_API _fn_SQLBindColType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN * StrLen_or_Ind);

typedef SQLRETURN SQL_API _fn_SQLBindParamType(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN * StrLen_or_Ind);

typedef SQLRETURN SQL_API _fn_SQLCancelType(SQLHSTMT StatementHandle);

typedef SQLRETURN SQL_API _fn_SQLCloseCursorType(SQLHSTMT StatementHandle);

typedef SQLRETURN SQL_API _fn_SQLColAttributeType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength, SQLLEN * NumericAttribute);

typedef SQLRETURN SQL_API _fn_SQLColumnsType(SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLCHAR * ColumnName, SQLSMALLINT NameLength4);

typedef SQLRETURN SQL_API _fn_SQLConnectType(SQLHDBC ConnectionHandle, SQLCHAR * ServerName, SQLSMALLINT NameLength1, SQLCHAR * UserName, SQLSMALLINT NameLength2, SQLCHAR * Authentication, SQLSMALLINT NameLength3);

typedef SQLRETURN SQL_API _fn_SQLDriverConnectType( SQLHDBC            hdbc, SQLHWND            hwnd, SQLCHAR               *szConnStrIn, SQLSMALLINT        cbConnStrIn, SQLCHAR           *szConnStrOut, SQLSMALLINT        cbConnStrOutMax, SQLSMALLINT           *pcbConnStrOut, SQLUSMALLINT       fDriverCompletion);

typedef SQLRETURN SQL_API _fn_SQLCopyDescType(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle);

typedef SQLRETURN SQL_API _fn_SQLDataSourcesType(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR * ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT * NameLength1, SQLCHAR * Description, SQLSMALLINT BufferLength2, SQLSMALLINT * NameLength2);

typedef SQLRETURN SQL_API _fn_SQLDescribeColType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR * ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT * NameLength, SQLSMALLINT * DataType, SQLULEN * ColumnSize, SQLSMALLINT * DecimalDigits, SQLSMALLINT * Nullable);

typedef SQLRETURN SQL_API _fn_SQLDisconnectType(SQLHDBC ConnectionHandle);

typedef SQLRETURN SQL_API _fn_SQLEndTranType(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType);

typedef SQLRETURN SQL_API _fn_SQLErrorType(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, SQLCHAR * Sqlstate, SQLINTEGER * NativeError, SQLCHAR * MessageText, SQLSMALLINT BufferLength, SQLSMALLINT * TextLength);

typedef SQLRETURN SQL_API _fn_SQLExecDirectType(SQLHSTMT StatementHandle, SQLCHAR * StatementText, SQLINTEGER TextLength);

typedef SQLRETURN SQL_API _fn_SQLExecuteType(SQLHSTMT StatementHandle);

typedef SQLRETURN SQL_API _fn_SQLFetchType(SQLHSTMT StatementHandle);

typedef SQLRETURN SQL_API _fn_SQLFetchScrollType(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);

typedef SQLRETURN SQL_API _fn_SQLFreeConnectType(SQLHDBC ConnectionHandle);

typedef SQLRETURN SQL_API _fn_SQLFreeEnvType(SQLHENV EnvironmentHandle);

typedef SQLRETURN SQL_API _fn_SQLFreeStmtType(SQLHSTMT StatementHandle, SQLUSMALLINT Option);

typedef SQLRETURN SQL_API _fn_SQLFreeHandleType(SQLSMALLINT HandleType, SQLHANDLE Handle);

typedef SQLRETURN SQL_API _fn_SQLGetConnectAttrType(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetConnectOptionType(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value);

typedef SQLRETURN SQL_API _fn_SQLGetCursorNameType(SQLHSTMT StatementHandle, SQLCHAR * CursorName, SQLSMALLINT BufferLength, SQLSMALLINT * NameLength);

typedef SQLRETURN SQL_API _fn_SQLGetDataType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN * StrLen_or_Ind);

typedef SQLRETURN SQL_API _fn_SQLGetDescFieldType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetDescRecType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR * Name, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength, SQLSMALLINT * Type, SQLSMALLINT * SubType, SQLLEN * Length, SQLSMALLINT * Precision, SQLSMALLINT * Scale, SQLSMALLINT * Nullable);

typedef SQLRETURN SQL_API _fn_SQLGetDiagFieldType(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetDiagRecType(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLCHAR * Sqlstate, SQLINTEGER * NativeError, SQLCHAR * MessageText, SQLSMALLINT BufferLength, SQLSMALLINT * TextLength);

typedef SQLRETURN SQL_API _fn_SQLGetEnvAttrType(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetInfoType(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetStmtAttrType(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetStmtOptionType(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value);

typedef SQLRETURN SQL_API _fn_SQLGetTypeInfoType(SQLHSTMT StatementHandle, SQLSMALLINT DataType);

typedef SQLRETURN SQL_API _fn_SQLNumResultColsType(SQLHSTMT StatementHandle, SQLSMALLINT * ColumnCount);

typedef SQLRETURN SQL_API _fn_SQLParamDataType(SQLHSTMT StatementHandle, SQLPOINTER * Value);

typedef SQLRETURN SQL_API _fn_SQLPrepareType(SQLHSTMT StatementHandle, SQLCHAR * StatementText, SQLINTEGER TextLength);

typedef SQLRETURN SQL_API _fn_SQLPutDataType(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind);

typedef SQLRETURN SQL_API _fn_SQLRowCountType(SQLHSTMT StatementHandle, SQLLEN * RowCount);

typedef SQLRETURN SQL_API _fn_SQLSetConnectAttrType(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength);

typedef SQLRETURN SQL_API _fn_SQLSetConnectOptionType(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value);

typedef SQLRETURN SQL_API _fn_SQLSetCursorNameType(SQLHSTMT StatementHandle, SQLCHAR * CursorName, SQLSMALLINT NameLength);

typedef SQLRETURN SQL_API _fn_SQLSetDescFieldType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength);

typedef SQLRETURN SQL_API _fn_SQLSetDescRecType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, SQLPOINTER Data, SQLLEN * StringLength, SQLLEN * Indicator);

typedef SQLRETURN SQL_API _fn_SQLSetEnvAttrType(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength);

typedef SQLRETURN SQL_API _fn_SQLSetStmtAttrType(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength);

typedef SQLRETURN SQL_API _fn_SQLSetStmtOptionType(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value);

typedef SQLRETURN SQL_API _fn_SQLSpecialColumnsType(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable);

typedef SQLRETURN SQL_API _fn_SQLStatisticsType(SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved);

typedef SQLRETURN SQL_API _fn_SQLTablesType(SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLCHAR * TableType, SQLSMALLINT NameLength4);

typedef SQLRETURN SQL_API _fn_SQLTransactType(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);

typedef SQLRETURN SQL_API _fn_SQLSetParamType(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN * StrLen_or_Ind);

class ODBCWrapper {
private:

    bool initDone;

    const char *libraryPath;

public:

	static DynLib *odbcLib;

	static _fn_SQLAllocConnectType* _fn_SQLAllocConnect;
	static _fn_SQLAllocEnvType* _fn_SQLAllocEnv;
	static _fn_SQLAllocStmtType* _fn_SQLAllocStmt;
	static _fn_SQLAllocHandleType* _fn_SQLAllocHandle;
	static _fn_SQLBindColType* _fn_SQLBindCol;
	static _fn_SQLBindParamType* _fn_SQLBindParam;
	static _fn_SQLCancelType* _fn_SQLCancel;
	static _fn_SQLCloseCursorType* _fn_SQLCloseCursor;
	static _fn_SQLColAttributeType* _fn_SQLColAttribute;
	static _fn_SQLColumnsType* _fn_SQLColumns;
	static _fn_SQLConnectType* _fn_SQLConnect;
	static _fn_SQLDriverConnectType* _fn_SQLDriverConnect;
	static _fn_SQLCopyDescType* _fn_SQLCopyDesc;
	static _fn_SQLDataSourcesType* _fn_SQLDataSources;
	static _fn_SQLDescribeColType* _fn_SQLDescribeCol;
	static _fn_SQLDisconnectType* _fn_SQLDisconnect;
	static _fn_SQLEndTranType* _fn_SQLEndTran;
	static _fn_SQLErrorType* _fn_SQLError;
	static _fn_SQLExecDirectType* _fn_SQLExecDirect;
	static _fn_SQLExecuteType* _fn_SQLExecute;
	static _fn_SQLFetchType* _fn_SQLFetch;
	static _fn_SQLFetchScrollType* _fn_SQLFetchScroll;
	static _fn_SQLFreeConnectType* _fn_SQLFreeConnect;
	static _fn_SQLFreeEnvType* _fn_SQLFreeEnv;
	static _fn_SQLFreeStmtType* _fn_SQLFreeStmt;
	static _fn_SQLFreeHandleType* _fn_SQLFreeHandle;
	static _fn_SQLGetConnectAttrType* _fn_SQLGetConnectAttr;
	static _fn_SQLGetConnectOptionType* _fn_SQLGetConnectOption;
	static _fn_SQLGetCursorNameType* _fn_SQLGetCursorName;
	static _fn_SQLGetDataType* _fn_SQLGetData;
	static _fn_SQLGetDescFieldType* _fn_SQLGetDescField;
	static _fn_SQLGetDescRecType* _fn_SQLGetDescRec;
	static _fn_SQLGetDiagFieldType* _fn_SQLGetDiagField;
	static _fn_SQLGetDiagRecType* _fn_SQLGetDiagRec;
	static _fn_SQLGetEnvAttrType* _fn_SQLGetEnvAttr;
	static _fn_SQLGetInfoType* _fn_SQLGetInfo;
	static _fn_SQLGetStmtAttrType* _fn_SQLGetStmtAttr;
	static _fn_SQLGetStmtOptionType* _fn_SQLGetStmtOption;
	static _fn_SQLGetTypeInfoType* _fn_SQLGetTypeInfo;
	static _fn_SQLNumResultColsType* _fn_SQLNumResultCols;
	static _fn_SQLParamDataType* _fn_SQLParamData;
	static _fn_SQLPrepareType* _fn_SQLPrepare;
	static _fn_SQLPutDataType* _fn_SQLPutData;
	static _fn_SQLRowCountType* _fn_SQLRowCount;
	static _fn_SQLSetConnectAttrType* _fn_SQLSetConnectAttr;
	static _fn_SQLSetConnectOptionType* _fn_SQLSetConnectOption;
	static _fn_SQLSetCursorNameType* _fn_SQLSetCursorName;
	static _fn_SQLSetDescFieldType* _fn_SQLSetDescField;
	static _fn_SQLSetDescRecType* _fn_SQLSetDescRec;
	static _fn_SQLSetEnvAttrType* _fn_SQLSetEnvAttr;
	static _fn_SQLSetStmtAttrType* _fn_SQLSetStmtAttr;
	static _fn_SQLSetStmtOptionType* _fn_SQLSetStmtOption;
	static _fn_SQLSpecialColumnsType* _fn_SQLSpecialColumns;
	static _fn_SQLStatisticsType* _fn_SQLStatistics;
	static _fn_SQLTablesType* _fn_SQLTables;
	static _fn_SQLTransactType* _fn_SQLTransact;
	static _fn_SQLSetParamType* _fn_SQLSetParam;

public:
	ODBCWrapper(const char *);
	virtual ~ODBCWrapper();

	bool init();

	void *resolve(const char *);

    SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC * ConnectionHandle);

    SQLRETURN SQL_API SQLAllocEnv(SQLHENV * EnvironmentHandle);

    SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT * StatementHandle);

    SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE * OutputHandle);

    SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN * StrLen_or_Ind);

    SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN * StrLen_or_Ind);

    SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle);

    SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);

    SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength, SQLLEN * NumericAttribute);

    SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLCHAR * ColumnName, SQLSMALLINT NameLength4);

    SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR * ServerName, SQLSMALLINT NameLength1, SQLCHAR * UserName, SQLSMALLINT NameLength2, SQLCHAR * Authentication, SQLSMALLINT NameLength3);

    SQLRETURN SQL_API SQLDriverConnect( SQLHDBC            hdbc, SQLHWND            hwnd, SQLCHAR               *szConnStrIn, SQLSMALLINT        cbConnStrIn, SQLCHAR           *szConnStrOut, SQLSMALLINT        cbConnStrOutMax, SQLSMALLINT           *pcbConnStrOut, SQLUSMALLINT       fDriverCompletion);

    SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle);

    SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR * ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT * NameLength1, SQLCHAR * Description, SQLSMALLINT BufferLength2, SQLSMALLINT * NameLength2);

    SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR * ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT * NameLength, SQLSMALLINT * DataType, SQLULEN * ColumnSize, SQLSMALLINT * DecimalDigits, SQLSMALLINT * Nullable);

    SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);

    SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType);

    SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, SQLCHAR * Sqlstate, SQLINTEGER * NativeError, SQLCHAR * MessageText, SQLSMALLINT BufferLength, SQLSMALLINT * TextLength);

    SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR * StatementText, SQLINTEGER TextLength);

    SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle);

    SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle);

    SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);

    SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);

    SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle);

    SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option);

    SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);

    SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

    SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value);

    SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR * CursorName, SQLSMALLINT BufferLength, SQLSMALLINT * NameLength);

    SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN * StrLen_or_Ind);

    SQLRETURN SQL_API SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

    SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR * Name, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength, SQLSMALLINT * Type, SQLSMALLINT * SubType, SQLLEN * Length, SQLSMALLINT * Precision, SQLSMALLINT * Scale, SQLSMALLINT * Nullable);

    SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength);

    SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLCHAR * Sqlstate, SQLINTEGER * NativeError, SQLCHAR * MessageText, SQLSMALLINT BufferLength, SQLSMALLINT * TextLength);

    SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

    SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT * StringLength);

    SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength);

    SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value);

    SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType);

    SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT * ColumnCount);

    SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER * Value);

    SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR * StatementText, SQLINTEGER TextLength);

    SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind);

    SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, SQLLEN * RowCount);

    SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength);

    SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value);

    SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR * CursorName, SQLSMALLINT NameLength);

    SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength);

    SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, SQLPOINTER Data, SQLLEN * StringLength, SQLLEN * Indicator);

    SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength);

    SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength);

    SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value);

    SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable);

    SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved);

    SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3, SQLCHAR * TableType, SQLSMALLINT NameLength4);

    SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);

    SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN * StrLen_or_Ind);

};


#endif // ODBCWRAPPER_H_
